package com.wangyi.fightimg.application;

import com.mob.MobApplication;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.wangyi.fightimg.utils.Constants;

/**
 * Created by tiger on 2017/8/1.
 */

public class MyApplication extends MobApplication {
    private IWXAPI api;

    public IWXAPI getApi() {
        return api;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        regToWx();
    }

    // 注册微信
    private void regToWx() {
        api = WXAPIFactory.createWXAPI(this, Constants.WX_APP_ID, true);
        api.registerApp(Constants.WX_APP_ID);
    }

}
